import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:myapp/bloc/authentication_bloc/authentication_bloc.dart';
import 'package:myapp/screens/home.dart';
import 'package:myapp/screens/welcome.dart';


// import 'bloc/articles_bloc/articles_bloc.dart';
import 'bloc/sign_in_bloc/sign_in_bloc.dart';


class AppWidget extends StatelessWidget {
  const AppWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Real World Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
        scaffoldBackgroundColor: Colors.transparent,
        appBarTheme: AppBarTheme(
          color: Colors.blue[800],
          titleTextStyle: const TextStyle(
            color: Colors.white,
            fontSize: 20,
            fontWeight: FontWeight.bold,
          ),
        ),
        textTheme: const TextTheme(
          bodyLarge: TextStyle(
            color: Colors.white,
            fontSize: 16,
          ),
        ),
        inputDecorationTheme: InputDecorationTheme(
          border: OutlineInputBorder(
            borderRadius: BorderRadius.circular(10.0),
          ),
          filled: true,
          fillColor: Colors.white.withOpacity(0.2),
          hintStyle: const TextStyle(
            color: Colors.white70,
          ),
        ),
        elevatedButtonTheme: ElevatedButtonThemeData(
          style: ElevatedButton.styleFrom(
            backgroundColor: Colors.blue[900],
            padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 16),
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(10.0),
            ),
            textStyle: const TextStyle(
              fontSize: 18,
              color: Colors.white,
            ),
          ),
        ),
        textButtonTheme: TextButtonThemeData(
          style: TextButton.styleFrom(
            foregroundColor: Colors.white,
          ),
        ),
      ),
      onGenerateRoute: routes(
              application: application,
      ),
      // home: BlocBuilder<AuthenticationBloc, AuthenticationState>(
      //    builder: ((context, state) {
      //     if (state.status == AuthenticationStatus.authenticated) {
      //       return MultiBlocProvider(
      //         providers: [
      //           BlocProvider(
      //               create: (context) => SignInBloc(context.read<AuthenticationBloc>().userRepository),
      //             ),
      //           // BlocProvider(
      //           //     create: (context) => ArticlesBloc()
      //           //   ),
      //         ],
      //         child: const HomeScreen());
      //       // return const HomeScreen();
      //     }
      //     else{
      //       return const WelcomeScreen();
      //     }
      //    }
      //    ),
      // )
    );
  }
}
